// ActionScript file
package com.app.factories{
	import com.adobe.serialization.json.JSONDecoder;
	import com.app.vo.TugasAkhirVO;
	
	import mx.controls.Alert;
	
	public class TugasAkhirFactory{
        public static function buildArrayFromJson(json:String):Array
        {     
            var parsedArray:Array= new JSONDecoder( json ).getValue();
            return parsedArray;
        }
        public static function buildDataComboTugasAkhir(data:String,taVo:TugasAkhirVO):TugasAkhirVO{
            var output:Array = buildArrayFromJson(data);
            taVo.taCombo=output;
            return taVo;
        }
        public static function buildDetilDataTugasAkhir(data:String,taVo:TugasAkhirVO):TugasAkhirVO{
        	
            var output:Array = buildArrayFromJson(data);
            taVo.taJudul=output[0]['TA_JUDUL'];
            taVo.taTopik=output[0]['TA_TOPIK'];
            taVo.taSemester= output[0]['TA_SEMESTER'];
            taVo.taStatus = output[0]['TA_STATUS'];
            return taVo;
        }
	}
}